<?php
namespace App\Http\Controllers\Index;
use App\Models\Company\CompanyBasic;
use App\Models\Company\CompanyJob;
use App\Models\Company\CompanyContact;
use App\Models\Company\CompanyDepartment;
use Style,DB,Site,Config;

class BaiduMapController extends CommonController{
    /**
     * 企业基本联系方式
     * @param $cid
     * @return mixed
     */
    public function index($cid){

        $cid = idDecryption($cid);
        $company = CompanyBasic::select('address','company_name','longitude','latitude')->where('id',$cid)->first();

        if($company){
            //logo
            if(!empty($company->logo)){
                $company->logo =  'upload/companylogo/'.$company->logo;
            }else{
                $company->logo = '/default/images/index/default_company_img.jpg';
            }

            empty($company->address) ? $company->address = '未填写' : '';
            empty($company->company_name) ? $company->company_name = '' : '';
        }

        return Style::view('index.baiduMap',compact('company'));
    }
}

